/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2019.
 * Description: led common code
 * Author: zhangwen
 * Create: 2019-12-18
 */

#ifndef __LED_COMMON_H__
#define __LED_COMMON_H__

#include <linux/hal/drol.h>
#ifdef CONFIG_ACPI
#include <linux/hal/acpi_op.h>
#endif

#define PROG_GREEN_LED_OFF 1
#define PROG_GREEN_LED_ON 2
#define PROG_GREEN_LED_RERERVSE 3

#define LED_NO_DEVICE 0
#define LED_GPIO 1
#define LED_CPLD 2

#define LED_OP_MAX 16

struct drol_led {
	char *name;
	struct drol_op *op;
	int op_nr;
};

enum led_mode_t {
	LED_INIT,
	LED_ON,
	LED_OFF,
	LED_END
};

#define DROL_LED_MATCH_LEN (LED_END + 1)

extern int led_type;
extern struct drol_led drol_led_match[DROL_LED_MATCH_LEN];

extern bool is_led_use_new_arch(void);
extern void led_base_init(drol_map map, drol_unmap unmap);
#ifdef CONFIG_ACPI
void led_acpi_base_init(struct acpi_device *dev, drol_map map, drol_unmap unmap);
#endif
void led_unmap(drol_unmap unmap);
void led_map(drol_map map, drol_unmap unmap);

#endif /* __LED_COMMON_H__ */

